package com.mdd.common.enums;

import com.google.common.collect.Maps;

import java.util.Map;

public enum OrderLogEnum {

    USER_ADD_ORDER(101, "用户提交订单"),
    USER_CANCEL_ORDER(102, "用户取消订单"),
    USER_CONFIRM_ORDER(103, "用户确认订单"),
    USER_PAY_ORDER(104, "用户支付订单"),
    USER_VERIFICATION(105, "师傅核销订单"),
    USER_STAFF_CONFIRM(106, "师傅确认订单"),
    USER_CANCEL_PAY(107, "用户取消支付"),

    SHOP_CANCEL_ORDER(201,"商家取消订单"),
    SHOP_REMARK_ORDER(202,"商家备注订单"),
    SHOP_VERIFICATION(203,"商家核销订单"),
    SHOP_DISPATCH_STAFF(204,"商家指派师傅"),

    SYSTEM_CANCEL_ORDER(301, "系统取消超时未付款订单"),
    SYSTEM_CONFIRM_ORDER(302, "系统核销订单"),
    SYSTEM_CANCEL_APPOINT_ORDER(303, "系统取消超过预约时间订单"),
    ;

    private final int code;
    private final String desc;

    OrderLogEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 获取状态码
     *
     * @return Long
     * @author fzr
     */
    public int getCode() {
        return this.code;
    }

    /**
     * 获取提示
     *
     * @return String
     * @author fzr
     */
    public String getDesc() {
        return this.desc;
    }

    public static Map<Integer, String> getMap() {
        Map<Integer, String> map = Maps.newHashMap();
        for (OrderLogEnum codeEnum : OrderLogEnum.values()) {
            map.put(codeEnum.code, codeEnum.desc);
        }
        return map;
    }
}
